﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Cobit5.BIZ.Common
{
    public class Cobit_SHA256
    {
        public static string GetSHA256(string in_String)
        {
            System.Security.Cryptography.SHA256 pwdSHA256 = System.Security.Cryptography.SHA256.Create();
            byte[] data = pwdSHA256.ComputeHash(Encoding.UTF8.GetBytes(in_String));
            StringBuilder sBuilder = new StringBuilder();
            for (int i = 0; i < data.Length; i++)
                sBuilder.Append(data[i].ToString("x2"));
            return sBuilder.ToString();
        }
    }
}
